<?php
/**
* @software         [JiJinCMS]
* @author           [上海集锦信息科技有限公司]
* @website          [http://www.jijinweb.com]
* @email            [sunny@jijinweb.com]
**/
namespace app\admin\validate;
use think\validate;
use think\facade\Db;
use think\facade\Request;
class TableFieldValidate extends validate{
    protected $regex = [ 'checkName' => '/^[a-z_0-9wd_]+$/i'];
    public $rule = [
        'table_id'  => ['require'],
        'formtype'  => ['require'],
        'field'  => ['require','regex'=>'checkName'],
        'name'  => ['require'],
    ];
    protected $message = [
        'table_id.require'=>'请选择数据表！',
        'formtype.require'=>'字段类型不能为空！',
        'field.require'=>'字段名称必须填写！',
        'field.regex'=>'字段名只支持英文数字和下划线',
        'name.require'=>'字段别名必须填写！',
    ];
}

